import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/Home.vue')
    },
    {
      path: '/managerhome',
      name: 'managerhome',
      component: () => import('../views/ManagerHome.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/register',
      name: 'register',
      props: true, // 确保路由参数作为 props 传递给组件
      component: () => import('../views/register.vue')
    },
    {
      path: '/volunteer-project',
      name: 'volunteerProject',
      component: () => import('../views/VolunteerProject.vue')
    },
    {
      path: '/project/:id',
      name: 'projectDetail',
      component: () => import('../views/VoluneerProjectDetail.vue')
    },
    {
      path: '/volunteer-team',
      name: 'volunteerTeam',
      component: () => import('../views/VolunteerTeam.vue')
    },
    {
      path: '/team/:id',
      name: 'teamDetail',
      component: () => import('../views/teamDetail.vue')
    },
    {
      path: '/volunteer-elegance',
      name: 'volunteerElegance',
      component: () => import('../views/VolunteerElegance.vue')
    },
    {
      path: '/notices-and-announcements',
      name: 'noticesAndAnnouncements',
      component: () => import('../views/NoticesAndAnnouncements.vue')
    },
    {
      path: '/media-coverage',
      name: 'mediaCoverage',
      component: () => import('../views/InformationUpdates.vue')
    },
    {
      path: '/policy-file',
      name: 'policyFile',
      component: () => import('../views/PolicyDocuments.vue')
    },
    {
      path: '/notice-announcement',
      name: 'noticeAnnouncement',
      component: () => import('../views/InformationUpdates.vue')
    },
    {
      path: '/personal-center',
      name: 'personalCenter',
      component: () => import('../views/PersonalCenter.vue')
    },
    {
      path: '/testupload',
      name: 'testupload',
      component: () => import('../views/testUpload.vue')
    },
    {
      path: '/activateAdd',
      name: 'activateAdd',
      component: () => import('../views/addActivateview.vue')
    },
    {
      path: '/information-detail/:id',
      name: 'informationDetail',
      component: () => import('../views/announDetails.vue')
    },
    {
      path: '/volunteerview/:id',
      name: 'volunteerView',
      component: () => import('../views/voluneerView.vue')
    },
    {
      path: '/medieaDetail/:id',
      name: 'medieaDetail',
      component: () => import('../views/medieaDetails.vue')
    },
    {
      path: '/organization-center',
      name: 'organizationCenter',
      component: () => import('../views/orgationCenter.vue')
    },
    {
      path: '/edit-activity/:activityId', // 动态路由参数
      name: 'EditActivity', // 路由名称
      component: () => import('../views/updateActivateView.vue') // 对应的组件
    },
    {
      path: '/adminHome',
      name: 'adminHome',
      component: () => import('../views/adminHome.vue')
    },
    {
      path: '/adminannouncementManage',
      name: 'announcementManage',
      component: () => import('../views/announcementManage.vue')
    },
    {
      path:'/lossPassword',
      name:'lossPassword',
      component: () => import('../views/lossPassword.vue')
    }
  ]
})

export default router
